BEGIN{
  act=ARGV[3];
  delete ARGV[3];
  te=ARGV[2];
  delete ARGV[2];
  ARGC-=2;
}
FNR==1{u=$1}
FNR>1{u+=$1}
FNR>1&&(($2==te||!te)&&($3==act||!act)){
  u1+=u;
  u2+=u*u;
  n++;
  print u;
}
END{
  print "U_mean="u1/n" RMS="sqrt(u2/n-(u1/n)^2)>"/dev/stderr";
}
